﻿@model Web.Models.Taoke.SearchModel
@{
    Layout = "~/Views/Shared/_TaokeRoot.cshtml";

    //title
    Html.AddTitleParts("搜索");
}
@using Nop.Core;
@using Nop.Core.Infrastructure;
@using Nop.Web;
@using Nop.Web.Framework;
@using Nop.Web.Framework.UI;
@using Nop.Web.Models.Catalog;
@using Nop.Web.Extensions;

@section search {
    
}
<div class="search-panel">
    @using (Html.BeginRouteForm("TaokeSearch", FormMethod.Get))
    {
        if (Model.Keyword == null)
        {
            Model.Keyword = "";
        }
        <div class="search-input">
            <input type="search" name="Keyword" id="small-searchterms" value="@Model.Keyword" onfocus="this.select()" />
        </div>
        
        <div class="search-results">
            @if (Model.TaokeItems.Count == 0)
            {
                <span class="result">
                    Sorry, 找不到相关记录, 请换一个关键词再试试^_^
                </span>
            }
@*product list*@
            @if (Model.TaokeItems.Count > 0)
            {
                <div class="info">亲，共找到 @Model.PagingFilteringContext.TotalItems 条记录.</div>
                <div class="product-list">
                    <ul data-role="listview" data-inset="true" data-filter="false" data-theme="c">
                        @foreach (var item in Model.TaokeItems)
                        {
                            <li>
                                @Html.Partial("_Item", item)
                            </li>
                        }
                    </ul>
                </div>
            }
            <div class="clear">
            </div>
            <div class="pager">
                @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber")
            </div>
        </div>
    }
</div>
